package com.gitee.ywj1352.webFlux.load;

import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;

/**
 * @author wenjie.yang on 2019/7/16.
 */
public class ReactiveDemo {
    public static void main(String[] args) {

        //适合 任务型的 少线程 多个任务长时间 执行
        Flux.just(1,2,3,4,5)//直接执行
                .map(v-> v-1).reduce((i,j)->i=i+j)
               // .subscribeOn(Schedulers.elastic())
                .subscribeOn(Schedulers.parallel())
        .subscribe(System.out::println);
    }


}
